Fix LiftImperativeExpression prepend ordering#41
Draft
keyboardDrummer-bot wants to merge 1 commit intomainfrom
Draft
Fix LiftImperativeExpression prepend ordering#41keyboardDrummer-bot wants to merge 1 commit intomainfrom
keyboardDrummer-bot wants to merge 1 commit intomainfrom
Conversation
…e calls When lifting an imperative call in expression position, save the previously accumulated prepended statements (from expressions processed earlier in right-to-left traversal) and place them after the lifted call. This ensures the call's declaration and assignment appear before the side-effects of expressions that follow it in program order. Also use the procedure's declared output type (from SemanticModel) when available, falling back to computeType only for multi-output or unknown cases. Fixes #39
Collaborator
Author
|
The "Run internal benchmarks of Strata" failure is an infrastructure issue, not a code issue. The benchmark CI job triggers an AWS CodeBuild build with I verified locally that:
This is the same issue noted in the main branch commit message: "Re-created from strata-org#1034 using an upstream branch so CI has access to required secrets." The benchmark job would need to be run from the upstream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the imperative call lifting in
LiftImperativeExpressions.leanas described in #39.Changes
When lifting an imperative call in expression position:
takePrepends(these come from expressions processed earlier in right-to-left traversal, e.g.,(x := 3)to the right of the call)SemanticModelwhen available (single output), falling back tocomputeTypeotherwiseliftedCall ++ previousPrependedStmtsTesting
addProc(...) + (x := 3)) still has an issue — see analysis in Fix bug in LiftImperativeExpression #39 commentNote
The uncommented test case doesn't pass yet because the call's arguments reference snapshot variables that are defined within
previousPrependedStmts. A further fix is needed to split the prepends into arg-generated vs outer prepends. See the detailed analysis in the issue comment.Fixes #39